Ext.define('AM.view.TastJobView', {
		extend: 'Ext.grid.Panel',
		alias : 'widget.tastJobView',
//			initComponent: function(){
//		Ext.apply(this,{
		store : 'TastJobStore',
		columnLines:true,
		id:'TastJobView_111',
		selModel : Ext.create('Ext.selection.CheckboxModel'), 
//		selModel: {
//	        injectCheckbox: 0,
//	        mode: "SIMPLE"     //"SINGLE"/"SIMPLE"/"MULTI"
//   		 },
//   		selType: "checkboxmodel",
    	dockedItems: [{
	        xtype: 'pagingtoolbar',
	        dock: 'bottom',
	        store : 'TastJobStore',
	        displayInfo: true
        }],
		columns: [
			        //{ text: '序号', width:50,align:'center',xtype: 'rownumberer'},
		            {text: '序号',  xtype: 'rownumberer',width:50,align:'center',tdCls:'background-color: #8EE5EE;'},
			        { text: '名称', dataIndex: 'name', width:120,align:'center'},
			        { text: '创建日期', dataIndex: 'creatDate',  width:100,align:'center',xtype: 'datecolumn',format:'Y-m-d'},
			        { text: '创建人',  dataIndex: 'employee',  width:100,align:'center'},
//			        { text: '类型',dataIndex: 'jobstyle', width:160,align:'center',renderer: function(value){
//					        	 if (value === 2) {
//										 return '临时性工作';
//								 }if (value === 1) {
//										 return '创新性工作';
//								 }
//						}
//			        },
			        { text: '状态',dataIndex: 'state', width:80,align:'center',renderer: function(value){
								 if (value === 1) {
										  return '<span style="color:purple;">未发布</span>'; 
								 }if (value ===2) {
								 	  return '<span style="color:green;">办理中</span>';
								 }if (value === 3) {
										return '<span style="color:red;">结束</span>';
								 }						 
						 }
			        },
			        { text: '内容',dataIndex: 'content', width:180,align:'center' },
			        { text: '操作', dataIndex: 'id',width:240,align:'center',renderer : function(data, cell, record, rowIndex,columnIndex){
			        	    var resultStr = "<div class='controlBtn'>" +     
                            "<a href='javascript:void("+record.get('id')+");'class='alarm_detail'onclick='addTastJobDetail("+record.get('id')+")'>添加详细</a>&nbsp;&nbsp;&nbsp;&nbsp;" +     
                            "<a href='javascript:void("+record.get('id')+");' class='alarm_detail'onclick='listTastJobDetail("+record.get('id')+")'>查看详情</a>&nbsp;&nbsp;&nbsp;&nbsp;" +  
                            "<a href='javascript:void("+record.get('id')+");' class='alarm_detail'onclick='FabuTastJob("+record.get('id')+")'>发布流程</a>"
                            "</div>";     
         					 return resultStr;  
			       		  }
         	    	}
				],
			   tbar: [
					  { xtype: 'button', text: '增加',id:'tab-73_add', handler:addTastJob,icon: 'Ext/restful/images/add.png'
					  },
					  { xtype: 'button',text: '修改',id:'tab-73_edit',handler:editTastJob,icon: 'Ext/restful/images/cog_edit.png'
					  },
					  { xtype: 'button', text: '删除',id:'tab-73_delete',icon: 'Ext/restful/images/delete.png'
					  },
					  '->',
					  {xtype : "datefield",
						 fieldLabel: '日期',
						 labelWidth:60,
						 name: 'searchdate',
						 format:'Y-m-d',
						 id:'searchtastjob_999'
					  },
					  { xtype: 'button', text: '查询',id:'tab-73_search',handler:searchTastjob,icon : 'Ext/restful/images/find.png'
					  }  
					]
//			});
//	   this.callParent(arguments);
//  	}
})
function deleteTastJob(){
				 var grid=this.ownerCt.ownerCt;
			     var selections = grid.getSelectionModel().getSelection();
					if(selections){
					if(selections.length==0){
							Ext.MessageBox.alert("提示","请检查是否选中某一行！");
						}else if (selections.length > 1) {
							Ext.MessageBox.alert("提示", "请检查您是否选中了多行！");
							return;
						} else{
							Ext.MessageBox.confirm("提示", "确认要删除 ？", function(btn) {
							if (btn == 'yes') {			
							var record = selections[0];
								Ext.Ajax.request({
										url : 'TastJobAction_deleteById',
										success : function() {
											Ext.MessageBox.alert("提示",
													"删除" + record.get("name")+ "成功！");
											    grid.getStore().remove(selections );
											    grid.getStore().reload();
										},
										failure : function() {
											Ext.MessageBox.alert("提示", "项目有具体工作内容，删除失败！");
										},
										params : {
											id : record.get("id")
										}
									});			
								}
					  	})
                   	} 
		   }				
	}
function searchTastjob(){
	var grid=this.ownerCt.ownerCt;
	var date= Ext.getCmp('searchtastjob_999').getValue();
	 grid.getStore().on('beforeload', function (store, options) {
		                  var new_params = {searchdate:Ext.util.Format.date(date, 'Y-m')}
		                        Ext.apply(store.proxy.extraParams, new_params);
		               });//此处为加载条件
	 grid.getStore().reload();
	
}
function addTastJob(){
	    var grid=this.ownerCt.ownerCt;
//	    jobView=Ext.create('AM.view.TastJobView');
		 var myform1= new Ext.form.Panel({
			        layout : "form",
			        labelWidth : 65,
			        items: [{
			        	layout : "column",
			       		border : false,
			        	items: [{
					        	columnWidth :.60,
								layout : "form",
								border : false,
								labelWidth : 30,
					   			items: [{
					   				    xtype : "textfield",
					   				    allowBlank:false,
					   				    fieldLabel: '项目名称',
					   				    blankText:"项目名称不能为空",
					   				    labelAlign :"right",
							            name: 'name',
							            width:30
							        }]		        	
				        		}]
				        },{
					         layout : "column",
					         border : false,			 
						     items: [{
							        	columnWidth :.40,
										layout : "form",
										border : false,
							   			items: [{
							   				    xtype : "datefield",
							   				    labelAlign :"right",
							   				    fieldLabel: '创建时间',
									            name: 'creatDate',
									            format:'Y-m-d'
									        }]		        	
						        		},{
						        		columnWidth :.40,
										layout : "form",
										border : false,
							   			items: [{
							   				     xtype : "combobox",
												 allowBlank:false,
												 emptyText:'选择等級',
												 editable:true,
												 selectOnFocus:true,
												 forceSelection: true,
												 queryMode: 'local',
												 labelAlign :"right",
												 fieldLabel: '等级',
												 name: 'core',
												 store :Ext.create('Ext.data.Store', {
														 fields: ['id', 'name'],
														  data : [		
															 		{"id":"100", "name":"院办公会决议"},
															        {"id":"80", "name":"院级正职"},
															        {"id":"50", "name":"院级副职"} 
																    ]
																}),
														 displayField: 'name',
														 valueField: 'id'
										        }]	
						        		}]
					  },{
			   		 	layout : "column",
					 	 border : false,
						 items: [{
						 		  columnWidth :.85,
						 		  layout : "form",
						 		  border : false,
						 		  items:[{
						 		  	 xtype : "textarea",
						      	     labelAlign :"right",
						             fieldLabel: '项目概要',
						             name: 'content',
						             height : 100
						 		  }]
							}]	
			   	 }]
		 })
			var win = new Ext.Window({
				title : "添加工作",
				width : 700,
				height : 300,
				frame:true,
				layout:'fit',
				items : [ myform1
							],
				buttons : [{
							text : "确定",
							handler : function() {
								win.getComponent(0).getForm().submit({
											    url : 'TastJobAction_addTastJob',
											    success : function() {
											    Ext.Msg.alert('提示', '添加成功');
											    win.close();
											    grid.getStore().reload();
											},
											failure : function() {
												Ext.Msg.alert('错误', '添加失败');
											},
											waitMsg : "请稍后，正在保存。。。。"
	
										});
							}
						}, {
							text : "重置",
							handler : function() {
								win.getComponent(0).getForm().reset();
							}
						}, {
							text : "取消",
							handler : function() {
												win.close();
											
							}
						}]
			});
		win.show();
	
}
function editTastJob(){
	    var grid=this.ownerCt.ownerCt;
		 var myform1= new Ext.form.Panel({
			        layout : "form",
			        labelWidth : 65,
			        items: [{
			        	layout : "column",
			       		border : false,
			        	items: [{
					        	columnWidth :.60,
								layout : "form",
								border : false,
								labelWidth : 30,
					   			items: [{
					   				    xtype : "textfield",
					   				    allowBlank:false,
					   				    fieldLabel: '项目名称',
					   				    blankText:"项目名称不能为空",
					   				    labelAlign :"right",
							            name: 'name',
							            width:30
							        }]		        	
				        		}]
				        },{
					         layout : "column",
					         border : false,			 
						     items: [{
							        	columnWidth :.40,
										layout : "form",
										 border : false,
							   			items: [{
							   				    xtype : "datefield",
							   				    labelAlign :"right",
							   				    fieldLabel: '创建时间',
									            name: 'creatDate',
									            format:'Y-m-d',
									            width:30
									        }]		        	
						        	},{
						        	
						        		columnWidth :.40,
										layout : "form",
										border : false,
							   			items: [{
						        		 xtype : "combobox",
										 allowBlank:false,
										 emptyText:'选择等級',
										 editable:true,
										 selectOnFocus:true,
										 forceSelection: true,
										 queryMode: 'local',
										 labelAlign :"right",
										 fieldLabel: '等级',
										 name: 'core',
										 store :Ext.create('Ext.data.Store', {
												 fields: ['id', 'name'],
												  data : [		
													 		{"id":"100", "name":"院办公会决议"},
													        {"id":"80", "name":"院级正职"},
													        {"id":"50", "name":"院级副职"} 
														  ]
														}),
												 displayField: 'name',
												 valueField: 'id'
						        		}]
						   		   }]
					  },{
			   		 	layout : "column",
					 	 border : false,
						 items: [{
							 		 columnWidth :.85,
							 		 layout : "form",
							 		  border : false,
							 		  items:[{
							 		  	  xtype : "textarea",
							      	      labelAlign :"right",
							             fieldLabel: '项目概要',
							             name: 'content',
							             height : 100
							 		  }]
								},{
									  columnWidth :.05,
							 		  layout : "form",
							 		  border : false,
							 		  items:[{
							 		  	  xtype : "textfield",
							      	      labelAlign :"right",
							              fieldLabel: 'ID',
							             name: 'id'
							 		  }]
								}]	
			   		 }]
		 })
			var win = new Ext.Window({
				title : "修改工作",
				width : 700,
				height : 300,
				frame:true,
				layout:'fit',
				items : [ myform1
							],
				buttons : [{
							text : "确定",
							handler : function() {
								win.getComponent(0).getForm().submit({
											    url : 'TastJobAction_editTastJob',
											    success : function() {
											    Ext.Msg.alert('提示', '修改成功');
											    win.close();
											    grid.getStore().reload();
											},
											failure : function() {
												Ext.Msg.alert('错误', '修改失败');
											},
											waitMsg : "请稍后，正在保存。。。。"
	
										});
							}
						}, {
							text : "重置",
							handler : function() {
								win.getComponent(0).getForm().reset();
							}
						}, {
							text : "取消",
							handler : function() {
												win.close();
											
							}
						}]
			});
			var selections = grid.getSelectionModel().getSelection();
						if(selections.length==0){
							Ext.MessageBox.alert("提示","请选择要编辑的一行！");
						}else if (selections.length > 1) {
							Ext.MessageBox.alert("提示", "请检查您是否选中了多行！");
							return;
						} else{
							var record = selections[0];
						//这里是修改操作的实现部分
							win.getComponent(0).getForm().loadRecord(record);
							win.show();
						}
	
}
function addTastJobDetail(id){
//	    jobView= Ext.getCmp('TastJobView_111');
	    jobView=Ext.create('AM.view.TastJobView');
		var selections = jobView.getSelectionModel().getSelection();
		var name = selections[0].data.name;
    var jobId=id;
	Ext.Ajax.request({
			url : 'DetailJobAction_addDetailJob',
			success : function() {
				  Ext.getCmp('mytastjob_1').getStore().on('beforeload', function (store, options) {
		                  var new_params = {id:jobId}
		                        Ext.apply(store.proxy.extraParams, new_params);
		               });//此处为加载条件
				  Ext.getCmp('mytastjob_1').getStore().reload();
				  win.show();
		
				},
			failure : function() {
						Ext.MessageBox.alert("提示", "项目正在办理中或已经完成！");
			},
			params : {
					    id:jobId	
					}
		});	
		var myform= new Ext.form.Panel({
			        layout : "form",
			        labelWidth : 65,
			        items: [{
						layout : "column",
						border : false,
						items: [{
					        	columnWidth :.50,
								layout : "form",
								border : false,
					   			items: [{
					   				    xtype : "textfield",
					   				    fieldLabel: '项目名称',
					   				    labelAlign :"right",
					   				    grow:true,
							            name: 'name',
							            value:name
							        }]		        	
				        		}]
				        },{
					         layout : "column",
					         border : false,			 
						     items: [{
							        	columnWidth :.25,
										layout : "form",
										border : false,
							   			items: [{
							   				    xtype : "datefield",
							   				    labelAlign :"right",
							   				    fieldLabel: '开始时间',
									            name: 'startdate',
									            format:'Y-m-d',
									            width:30,
									             listeners: {
															select :function( field, value, eOpts ){     
																        var parent=Ext.getCmp('planCompleteDate_111');
																		 parent.setValue(value);	 
														        }
												        }
									        }]		        	
				        
						        		},{
						        		   columnWidth :.25,
										   layout : "form",
										   border : false,
									   	   items: [{
									   				    xtype : "datefield",
									   				    labelAlign :"right",
									   				    fieldLabel: '计划完成时间',
											            name: 'planCompleteDate',
											            id:'planCompleteDate_111',
											            format:'Y-m-d',
											            width:30
									       			 }]		
							        		
								    }]
					    },{
							 layout : "column",
							 id:'deptanddepart',
							 border : false,
							 items: [{
								       columnWidth :.25,
								       layout : "form",
								       border : false,
									   items:[{
													xtype : "combobox",
										      	    emptyText:'请选择科室',
										      	    selectOnFocus:true,
										      	    id:'depart_990',
													forceSelection: true,
										      	    labelAlign :"right",
										            fieldLabel: '科室',
										            queryMode: 'local',
										            triggerAction:'all', 
//										            multiSelect:true, //多选
										            name: 'depart',
										            store :"TargetDepartStore",
										            displayField: 'name',
	    											valueField: 'name',
										            listeners:{   
																select:function(combo, record,index){
																	 try{
																		 var parent=Ext.getCmp('person_990');
																		 parent.clearValue();
																		 parent.store.load({params:{param:this.value}});
																	 }
																	 catch(ex){
																		 Ext.MessageBox.alert("错误","数据加载失败。");
																	 }
																}
															}
											 }]						        		           	
									},{
							        	columnWidth :.25,
							        	layout : "form",   
							            border : false,
									    items:[{
										        	 fieldLabel: '岗位—人员',
										        	 emptyText:'请选择人员',
										      	     xtype:"combobox",
										      	     labelAlign :"right",
										      	     selectOnFocus:true,
													 forceSelection: true,
										      	     queryMode: 'local',
										      	     id:'person_990',
										      	     name: 'emp',
										      	     store :"SearchAddJobEmpStore",
										             displayField: 'name',
	    											 valueField: 'name'
										        }]
									},{
										columnWidth :.20,
									     layout : "form",
									     border : false,
									     items: [{
									   			     xtype : "numberfield",
									   				 labelAlign :"right",
									   				 fieldLabel: '科室占比',
									   				 blankText:"必须为数字",
									   				 minValue: 0,
											         name: 'deptbili',
											         id:'deptbili'
									       }]	
									},{
										columnWidth :.03,
									    layout : "form",
									    border : false,
									    items:[{
										     		border : false
										      	}]
									},{ 
										columnWidth :.15,
									    layout : "form",
									    border : false,
									    items:[{
										      	   xtype:'button',
										      	   labelAlign :"right",
										      	   text:'继续添加',
										      	   handler:function(){
										      	   Ext.getCmp('allperson').setVisible(true);
										      	   var val=Ext.getCmp('depart_990').getValue();
										      	   var values=Ext.getCmp('person_990').getValue();
										      	   var bili=Ext.getCmp('deptbili').getValue();
										      	   var va= Ext.getCmp('allperson').getValue();
										      	   Ext.getCmp('allperson').setValue(va+"["+val+"-"+values+"-"+bili+"]"+",");
										      	   var parent=Ext.getCmp('person_990');
												   parent.clearValue();
												   var son=Ext.getCmp('depart_990');
												   son.clearValue();
												   var bili=Ext.getCmp('deptbili');
												   bili.reset();
										     	}
										}]
								}]
						 },{
						 	 layout : "column",
						 	 border : false,
							        	items: [
							        		{
							        		    columnWidth :.8,
												layout : "form",
												border : false,
									   			items: [{
									   				    xtype : "textfield",
									   				    hidden : true,
									   				    id:'allperson',
									   				    labelAlign :"right",
									   				    fieldLabel: '已添加',
											            name: 'had' 
											            
									       			 }]		        	
							        		}]					 
						 }
						 ,{
							    layout : "column",
						         border : false,			 
							     items: [ {
								        	columnWidth :.30,
								        	layout : "form",
								        	border : false,
										    items:[{
											      	  xtype: 'filefield',
								                     labelAlign:'right',
								                     name: 'upload',
								                     msgTarget: 'side',
								                     buttonText:'浏览...',
								                     fieldLabel: '添加附件'
										        }]
							        	
							        	}]
						 },
						 	{
						 	 layout : "column",
					         border : false,			 
						     items: [ {
							        	columnWidth :.75,
							        	layout : "form",
							        	border : false,
									    items:[{
									      	    xtype : "textarea",
									      	    labelAlign :"right",
									            fieldLabel: '工作要求',
									            name: 'jobRequirement',
									            height : 60
									        }]
						        	
						        	},{
						        		columnWidth :.1,
										layout : "form",
										border : false,
									   	items: [{
									   		      xtype : "textfield",
									   			  labelAlign :"right",
									   			  fieldLabel: '所属项目',
											      name: 'tastJob.id',
											      value: jobId,
											      hidden:true
							        	  }]
						        	},{
						        		columnWidth :.10,
										layout : "form",
										border : false,
									   	items: [{
									   			  xtype : "textfield",
									   			  labelAlign :"right",
									   			  fieldLabel: '状态',
											      name: 'state',
											      value: 1,
											      hidden:true         
							        	  }]
						        	}]
	
						 }],
			        	buttons : [{
							text : "添加步骤",
							handler : function() {	                
							  win.getComponent(0).getForm().submit({
										url : 'DetailJobAction_addDetails',
										success : function() {					
											Ext.Msg.alert('提示', '添加成功');
											win.getComponent(0).getForm().reset();
											Ext.getCmp('mytastjob_1').getStore().reload();
										},
										failure : function() {
											Ext.Msg.alert('错误', '添加失败');
										},
											waitMsg : "请稍后，正在保存。。。。"										
						    	});
						   }
						}, {
							text : "重置",
							handler : function() {
								win.getComponent(0).getForm().reset();
							}
						}]
			    });
	  var mygrid1=Ext.create('Ext.grid.Panel', {
				    id:'mytastjob_1',
				    height: 215,
					width: 990,
				    columnLines:true,
				    store:'DetailJobStore',
				    selModel : Ext.create('Ext.selection.CheckboxModel'), 
				    columns: [
						    { text: '序号', width:50,align:'center',xtype: 'rownumberer'},
						    { text: 'ID',dataIndex: 'id',width:0,align:'center'},
					        { text: '名称', dataIndex: 'name', width:100,align:'center'},
					        { text: '所属项目', dataIndex:'tastJob.name', width:130,align:'center'},
					        { text: '科室',  dataIndex: 'department.name',  width:110,align:'center' },
					        { text: '人员',dataIndex: 'employee.name', width:110,align:'center' },
					        { text: '开始时间', dataIndex: 'startdate', width:90,align:'center',xtype: 'datecolumn',format:'Y-m-d'},
					        { text: '计划完成时间',  dataIndex: 'planCompleteDate',  width:100,align:'center',xtype: 'datecolumn',format:'Y-m-d' },
					        { text: '要求', dataIndex: 'jobRequirement', width:350,align:'center'}
				    	 ],
				   tbar: [
//						  { xtype: 'button', text: '修改步骤',icon: 'Ext/restful/images/cog_edit.png'
//						  },
						  { xtype: 'button', text: '删除步骤',handler:deletTastJobDetail,icon: 'Ext/restful/images/delete.png'
						  }
						]
				});
		var win = new Ext.Window({
				        title : "添加步骤",
					    width : 1000,
					    height : 530,
						closable : true,
					    draggable : true,
					    frame:true,
					    modal: true,
					    minimizable:true,
					    maximizable:true, 
					    layout : 'anchor',
					    plain : true,
					    items: [ myform, mygrid1],
					    buttons : [{
								text : "确定",
									handler : function() {	
											win.close();
									}												
								},{text : "取消",
								    handler : function() {
//										Ext.Ajax.request({
//											url : 'DetailJobAction_deleteByJobId',
//											failure : function() {
//												Ext.MessageBox.alert("提示", "项目具体内容未删除完全！");
//											},
//											params : {
//												id:jobId	
//											}
//										});		
										win.close();			
									}
							},{
								text : "删除所有",
								handler : function() {
										Ext.Ajax.request({
											url : 'DetailJobAction_deleteByJobId',
											failure : function() {
												Ext.MessageBox.alert("提示", "项目具体内容未删除完全！");
											},
											params : {
												id:jobId	
											}
										});		
										win.close();			
									}
							}]
						})
						
		function deletTastJobDetail(){
				 var grid=this.ownerCt.ownerCt;
			     var selections = grid.getSelectionModel().getSelection();
					if(selections){
					if(selections.length==0){
							Ext.MessageBox.alert("提示","请检查是否选中某一行！");
						}else if (selections.length > 1) {
							Ext.MessageBox.alert("提示", "请检查您是否选中了多行！");
							return;
						} else{
							Ext.MessageBox.confirm("提示", "确认要删除 ？", function(btn) {
							if (btn == 'yes') {			
							var record = selections[0];
								Ext.Ajax.request({
										url : 'DetailJobAction_deleteById',
										success : function() {
											Ext.MessageBox.alert("提示",
													"删除" + record.get("name")+ "成功！");
												Ext.getCmp('mytastjob_1').getStore().remove(selections );
												Ext.getCmp('mytastjob_1').getStore().reload();
										},
										failure : function() {
											Ext.MessageBox.alert("提示", "删除失败！");
										},
										params : {
											id : record.get("id")
										}
									});			
								}
					  	})
                   	} 
 			   
		   }				
	}			
}
//发布工作
   function FabuTastJob(id){
   			Ext.Ajax.request({
					url : 'TastJobAction_fabu',
					success : function() {
						jobView=Ext.create('AM.view.TastJobView');
						jobView.getStore().reload();
					},
					failure : function() {
						Ext.MessageBox.alert("提示", "项目正在办理中或已经完成！");
					},
					params : {
							id:id	
					}
		});	
   
 }
  	//查看工作详情
function listTastJobDetail(id){
      var jobid=id;			  
	 var mygrid=Ext.create('Ext.grid.Panel', {
				    width : 990,
				    columnLines:true,
				    store:'DetailJobStore',
				    plugins: [{
			            ptype: 'rowexpander',
			            rowBodyTpl : new Ext.XTemplate(
			                '<p><b>要求:</b> {jobRequirement}</p>'
			            )
			        }],
				    columns: [
				    { text: '序号', width:50,align:'center',xtype: 'rownumberer'},
			        { text: '名称', dataIndex: 'name', width:100,align:'center'},
			        { text: '所属项目', dataIndex:'tastJob.name', width:120,align:'center'},
			        { text: '科室',  dataIndex: 'department.name',  width:100,align:'center' },
			        { text: '人员',dataIndex: 'employee.name', width:100,align:'center' },
			        { text: '开始时间', dataIndex: 'startdate', width:90,align:'center',xtype: 'datecolumn',format:'Y-m-d'},
			        { text: '计划完成时间',  dataIndex: 'planCompleteDate',  width:100,align:'center',xtype: 'datecolumn',format:'Y-m-d' },
			        { text: '状态',  dataIndex:'state',  width:80,align:'center',renderer: function(value){
								 if (value === 1) {
										 return '未办理';
								 }if (value ===2) {
										 return '办理中';
								 }if (value === 3) {
										 return '结束';
								 }	
			       		 }
			        },
			        { text: '附件',  dataIndex: 'fujian',  width:100,align:'center' },
			        { text: '要求', dataIndex: 'jobRequirement', width:120,align:'center'}
			      
				     ]
				});
	 	
	 	var win = new Ext.Window({
				title : "项目详情",
				width : 1000,
				height : 350,
				minimizable:true,
	    	    maximizable:true,
				frame:true,
				layout:'fit',
				items :[mygrid],
				buttons : [{
							text : "确定",
							handler : function() {
								win.close();
							}
						},{
							text : "关闭",
							handler : function() {
							win.close();
											
							}
						}]
			});
		//此处为加载条件
	  mygrid.getStore().on('beforeload', function (store, options) {
        	 var new_params = { id:jobid}
        	 Ext.apply(store.proxy.extraParams, new_params);
	  });
	 mygrid.getStore().reload();
	  win.show();
 }


		   